package com.mate.cloud.codegen;


import jakarta.annotation.Resource;
import org.jasypt.encryption.StringEncryptor;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;



@SpringBootTest
public class GenCodeApplicationTests {
	@Resource
	private StringEncryptor stringEncryptor;

	@Test
	public void encrypt() {
		String encrypt = stringEncryptor.encrypt("im01");
		String encryptPwd = stringEncryptor.encrypt("yxw@123!");

		//UUID  加密后的内容：AkZs6tdmJojZe74vfIi5BRXbUvqkBiNQrn3RO22GeqW9sBjbNuIcNz+GdqkqJ8DQ
		System.out.println("im01：" + encrypt);
		System.out.println("yxw@123!：" + encryptPwd);
		// 解密
		String decrypt = stringEncryptor.decrypt(encrypt);
		String decryptPwd = stringEncryptor.decrypt(encryptPwd);
		System.out.println("解密后的内容：" + decrypt);
		System.out.println("解密后的内容：" + decryptPwd);
	}


}
